/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once

#include "节点/节点.h"

#include <向量.h>
#include <字符串转换.h>
//#include <filesystem>


class C_路径插座 : public C_插座基类 {

public:
	C_路径插座(std::wstring name);
	~C_路径插座();

	S_Props m_Value;

	void*       f_getData(uint8 当前插座连接线ID);
	void        f_setData(void* data, uint8 线程ID = 0);
	std::string f_构建变量代码();
	bool        f_接入插座是否匹配(E_值类型 type);

	void		f_读取(FILE* f);
	void		f_写入(FILE* f);
	std::wstring		f_getTypeName() { return L"path"; }
};

#define DEF_路径插座(socket)  dynamic_cast<C_路径插座*>( (socket) )
#define DEF_路径插座数据(socket, tid)  ((std::filesystem::path*)( (socket)->f_getData(tid)) )

#define DEF_创建路径插座_I(name) socket = new C_路径插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建路径插座_O(name) socket = new C_路径插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);






class C_字符串插座 : public C_插座基类 {

public:
	C_字符串插座(std::wstring name);
	~C_字符串插座();

	S_Props m_Value;

	void*       f_getData(uint8 当前插座连接线ID);
	void        f_setData(void* data, uint8 线程ID = 0);
	std::string f_构建变量代码();
	bool        f_接入插座是否匹配(E_值类型 type);

	void		f_读取(FILE* f);
	void		f_写入(FILE* f);
	std::wstring		f_getTypeName() { return L"path"; }
};

#define DEF_字符串插座(socket)  dynamic_cast<C_字符串插座*>( (socket) )
#define DEF_字符串插座数据(socket, tid)  ((std::wstring*)( (socket)->f_getData(tid)) )

#define DEF_创建字符串插座_I(name) socket = new C_字符串插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建字符串插座_O(name) socket = new C_字符串插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);






